<?php 
include("global.php"); 

if(true == checkLogin())
{

        session_start();
        
        $key_mod =urlencode("rubrica=fax&operation=new");
        $colspan=3;
        
        global $ADMIN;
       
        $LISTA_RUBRICA_FAX=$_SESSION['LISTA_RUBRICA_FAX'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
            <link rel="stylesheet" type="text/css" href="style/overlay-apple.css"/> 
            <link rel="stylesheet" type="text/css" href="style/themes/blue/style.css"/> 

		
	</head>
	<body>
           
            <div >
                <fieldset>
                <fieldset ><legend><b>Rubrica Fax</b></legend>
                    <?php 
                    if($ADMIN == $_SESSION['u_name'])
                    {
                        $colspan=4;
                        print('<a href="files/php/addnewRubrica.php?key='.$key_mod.'" rel="#overlay" ><img src="img/table-images/new.png"  width="30" height="30" border="0" /></a>');
                    }
                    
                    if(count($LISTA_RUBRICA_FAX) == 0)
                    {
                        print("<h4>Non sono presenti dati nella rubrica Rubrica Fax</h4>
                            </fieldset>
                            </fieldset>
                            <div class=\"apple_overlay\" id=\"overlay\">
			<div class=\"contentWrap\"></div>
                            </div>");
                    }
                    else
                    {
                    ?>
                   <table cellspacing="1" class="tablesorter" id="myTable">

                            <thead>
                                    <tr>
                                            <th>Id</th>
                                            <th>Nome</th>
                                            <th>Azienda</th>
                                            <th>Numero Fax</th>
                                            <?php if($ADMIN == $_SESSION['u_name']) 
                                                print('<th colspan="2">Operazione</th>');
                                            ?>
                                    </tr>
                            </thead>
                                 <tfoot>
                                <tr>
                                        <td colspan="<?php echo $colspan;?>" class="rounded-foot-left"><em>Elenco elementi rubrica fax</em></td>
                                        <td class="rounded-foot-right">&nbsp;</td>
                                </tr>
                            </tfoot>
                            <tbody>
                                    <?php
                                    printForm($LISTA_RUBRICA_FAX,"fax");
                                    ?>
                            </tbody>
                    </table>
               <?php 
                    }
                ?>
                </fieldset>
                 <?php 
                if(count($LISTA_RUBRICA_FAX))
                {
                ?>
                    <div id="pager" class="pager">
                <form>
                        <img src="images/icon/first.png" class="first"/>
                        <img src="images/icon/prev.png" class="prev"/>
                        <input type="text" class="pagedisplay"/>
                        <img src="images/icon/next.png" class="next"/>
                        <img src="images/icon/last.png" class="last"/>
                        <select class="pagesize">
                                <option selected="selected"  value="10">10</option>

                                <option value="20">20</option>
                                <option value="30">30</option>
                                <option  value="40">40</option>
                        </select>
                </form>
                </div>
                     <?php 
                }
                ?>
                </fieldset>
                </div>
                <br></br>

                
                
                <div class="apple_overlay" id="overlay">
                            <div class="contentWrap"></div>
                </div>
                
              

	</body>
</html>
<?php
}
else
{
    $arr=explode("/",($_SERVER['PHP_SELF']));
    $url = "http://" . $_SERVER['SERVER_NAME'] . "/index.php";
    $url.= "?url=/Rubrica.php";
    header( "Location: $url" ) ;
    return false;
}
    
?>